package ming.model.type;

import org.apache.commons.lang.StringUtils;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@SuppressWarnings("serial")
@Entity
@Table(name = "T_QUESTIONNAIRE_TABLESLOG", catalog = "")
public class Tableslog implements java.io.Serializable {

	// Fields

	private String id;
	private Tablesanswer tablesanswer;
	private String studentNo;
	private String studentName;
	private String question;
	private Integer result;


	// Property accessors
	@Id
	@Column(name = "vcId", unique = true, nullable = false, length = 36)
	public String getId() {
		if (!StringUtils.isBlank(this.id)) {
			return this.id;
		}
		return UUID.randomUUID().toString();
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "vcAnswerId")
	public Tablesanswer getTablesanswer() {
		return this.tablesanswer;
	}

	public void setTablesanswer(Tablesanswer tablesanswer) {
		this.tablesanswer = tablesanswer;
	}

	@Column(name = "vcStudentNo", length = 20)
	public String getStudentNo() {
		return this.studentNo;
	}

	public void setStudentNo(String studentNo) {
		this.studentNo = studentNo;
	}

	@Column(name = "vcStudentName", length = 200)
	public String getStudentName() {
		return this.studentName;
	}

	public void setStudentName(String studentName) {
		this.studentName = studentName;
	}

	@Column(name = "vcQuestion", length = 400)
	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}
	
	@Column(name = "intResult")
	public Integer getResult() {
		return this.result;
	}

	public void setResult(Integer result) {
		this.result = result;
	}

}